﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Services;
using Domain;

namespace WebRole1
{
	public partial class ChangeRootPW : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			UserService userServ = new UserService();
			User user = userServ.getUserDetails("root");

			if(user.IsPWChanged)
			{
				Response.Redirect("index");
			}

		}

		protected void btnChangePassword_Click(object sender, EventArgs e)
		{
			UserService userServ = new UserService();
			userServ.UpdateUser("root", txtPassword.Text);
		}
	}
}